<?php
namespace app\admin\controller;
use app\admin\model\User;
use think\Request;
use think\Controller;
use think\Db;
use app\admin\model\Goodsimages;
use app\admin\model\Goods;
use app\admin\model\Attr;
use app\admin\model\Cart;
use app\admin\model\Order;
  class indent extends Controller
  {
    public function indent_one()
    {
      $result = Order::order('create_time desc' )->paginate(2);
      $this->assign('result',$result);
      $list = Cart::where('status','in','0')->select();
      $this->assign('list',$list);
      ///var_dump($list);
      //exit();
      return $this->fetch();  
    }


    //修改订单的信息
  public function  indent_update(){
     //var_dump($_POST);
     //exit();
       $update = new Order;
       $update->save([
                        'count'    =>  input('post.count'),    //数量
                        'moneys'   =>  input('post.moneys'),    //总价
                        'ispay'  =>  input('post.ispay'),      //状态
                        'address'    =>  input('post.address'),    //收货地址
                    ],['id' => input('post.id')]);         

      $this->redirect('indent_one');
    }
   //点击删除会员订单信息
    public function indent_delete()
      {
        $request = Request::instance();
          if($request->isAjax()){ 
              $gid = input('mid');
             Order::where('id',$gid)->delete();    
        }    

      }



  }